// var webpack = require('webpack')

// var API_URL = {
//     production: 'https://oa.m.tencent.com/an:ntsapps_dev/mhrdeliverchat',
//     // production: 'http://10.12.75.137',
//     development: 'http://10.12.75.137'
// }
// var environment = process.env.NODE_ENV === 'production' ? 'production' : 'development';

module.exports = {
    outputDir:'mhrdeliverchat',
    publicPath: process.env.NODE_ENV === 'production'? './': '/',
    devServer: {
        proxy: {
            "/ChatService": {
                // target: "http://10.12.75.137",
                target: "http://ocss.oa.com",
                // target: "http://ntsapps.oa.com/mhrdeliverchat",
                ws: true,
                changeOrigin: true
            },
        }
    },
    chainWebpack: config => {
        config.module
        .rule('images')
        .test(/\.(png|jpe?g|gif|webp)(\?.*)?$/)
        .use('url-loader')
            .loader('url-loader')
            .options({
                limit:1,
                name:'[name].[ext]',
                outputPath: "img/"
            })
        // config
        //     .plugin('html')
        //     .tap(args => {
        //       args[0].API_URL = API_URL[environment]
        //       return args
        //     })
    }

};
